[1/4] fbdev: fbmem: Fix logo center image dx issue
authorGuiling Deng <greens9@163.com>
Tue, 28 Jun 2022 16:36:41 +0000 (09:36 -0700)
committerBen Hutchings <benh@debian.org>
Sat, 23 Jul 2022 22:32:10 +0000 (23:32 +0100)
Origin: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit?id=d03e8ed72d7dae6874ee6cf7ae02029a727e7559

commit 955f04766d4e6eb94bf3baa539e096808c74ebfb upstream.

Image.dx gets wrong value because of missing '()'.

If xres == logo->width and n == 1, image.dx = -16.

Signed-off-by: Guiling Deng <greens9@163.com>
Fixes: 3d8b1933eb1c ("fbdev: fbmem: add config option to center the bootup logo")
Cc: stable@vger.kernel.org # v5.0+
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Gbp-Pq: Topic bugfix/all
Gbp-Pq: Name fbdev-fbmem-fix-logo-center-image-dx-issue.patch

drivers/video/fbdev/core/fbmem.c

index 00939ca2065a947c7c741191f99120d4f74a916f..bf61770f6f6b987534a60e2c54a0c1e9d1126ee3 100644 (file)
@@ -513,7 +513,7 @@ static int fb_show_logo_line(struct fb_info *info, int rotate,
 
                while (n && (n * (logo->width + 8) - 8 > xres))
                        --n;
-               image.dx = (xres - n * (logo->width + 8) - 8) / 2;
+               image.dx = (xres - (n * (logo->width + 8) - 8)) / 2;
                image.dy = y ?: (yres - logo->height) / 2;
        } else {
                image.dx = 0;